﻿<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:Avanade="urn:Avanade" xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
  <xsl:template match="/">
    <xsl:choose>
      <!-- Titre et chapeau -->
      <xsl:when test="//DisplayStyle = '0'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart VIDEO">
          <tr>
            <td style="padding:2px 1px 2px 4px">
              <xsl:for-each select="xml/rs:data/z:row">
                <table width="100%" border="0" cellspacing="2" cellpadding="2">
                  <tr>
                    <td>
                      <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                        <xsl:value-of select="current()/@ows_Surtitre" />
                      </span>
                      <br />
                      <xsl:choose>
                        <xsl:when test="normalize-space(//BaseUrl) != ''">
                          <a style="font-size:11px;font-weight:bold">
                            <xsl:attribute name="href">
                              <xsl:value-of select="//BaseUrl" />
                              <xsl:value-of select="current()/@ows_ID" />
                            </xsl:attribute>
                            <span style="color:#ce2d6b">
                              <xsl:value-of select="current()/@ows_Title" />
                            </span>
                          </a>
                        </xsl:when>
                        <xsl:otherwise>
                          <span style="font-size:11px;font-weight:bold;color:#ce2d6b">
                            <xsl:value-of select="current()/@ows_Title" />
                          </span>
                        </xsl:otherwise>
                      </xsl:choose>
                      <span style="color:gray;font-size:8px;font-weight:bold">
                        (<xsl:value-of select="Avanade:FormatDate(current()/@ows_Created)" />)
                      </span>
                      <br/>
                      <div style="clear:both;vertical-align:top">
                        <xsl:if test="normalize-space(translate(current()/@ows_Photo, ',', '')) != ''">
                          <div style="float:left;padding-right:10px">
                            <a>
                              <xsl:if test="normalize-space(//BaseUrl) != ''">
                                <xsl:attribute name="href">
                                  <xsl:value-of select="//BaseUrl" />
                                  <xsl:value-of select="current()/@ows_ID" />
                                </xsl:attribute>
                              </xsl:if>
                              <img style="border:solid 1px #fce4ee;">
                                <xsl:attribute name="src">
                                  <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)" />
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                        <div style="margin-top:5px">
                            <xsl:value-of select="Avanade:FormatBody(current()/@ows_Chapeau)" />
                        </div>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="height:1px;background-color:#fce4ee;"></td>
                  </tr>
                </table>
              </xsl:for-each>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Titre et chapeau (Sans date) -->
      <xsl:when test="//DisplayStyle = '1'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart VIDEO">
          <tr>
            <td style="padding:2px 1px 2px 4px">
              <xsl:for-each select="xml/rs:data/z:row">
                <table width="100%" border="0" cellspacing="2" cellpadding="2">
                  <tr>
                    <td>
                      <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                        <xsl:value-of select="current()/@ows_Surtitre" />
                      </span>
                      <br />
                      <xsl:choose>
                        <xsl:when test="normalize-space(//BaseUrl) != ''">
                          <a style="font-size:11px;font-weight:bold">
                            <xsl:attribute name="href">
                              <xsl:value-of select="//BaseUrl" />
                              <xsl:value-of select="current()/@ows_ID" />
                            </xsl:attribute>
                            <span style="color:#ce2d6b">
                              <xsl:value-of select="current()/@ows_Title" />
                            </span>
                          </a>
                        </xsl:when>
                        <xsl:otherwise>
                          <span style="font-size:11px;font-weight:bold;color:#ce2d6b">
                            <xsl:value-of select="current()/@ows_Title" />
                          </span>
                        </xsl:otherwise>
                      </xsl:choose>
                      <br/>
                      <br/>
                      <div style="clear:both;vertical-align:top">
                        <xsl:if test="normalize-space(translate(current()/@ows_Photo, ',', '')) != ''">
                          <div style="float:left;padding-right:10px">
                            <a>
                              <xsl:if test="normalize-space(//BaseUrl) != ''">
                                <xsl:attribute name="href">
                                  <xsl:value-of select="//BaseUrl" />
                                  <xsl:value-of select="current()/@ows_ID" />
                                </xsl:attribute>
                              </xsl:if>
                              <img style="border:solid 1px #fce4ee;">
                                <xsl:attribute name="src">
                                  <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)" />
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                          <div>
                            <xsl:value-of select="Avanade:FormatBody(current()/@ows_Chapeau)" />
                          </div>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="height:1px;background-color:#fce4ee;"></td>
                  </tr>
                </table>
              </xsl:for-each>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Titre et Surtitre -->
      <xsl:when test="//DisplayStyle = '2'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart ANNONCE">
          <tr>
            <td style="background-color:#ffffff;width:100%;vertical-align:top;height:0%;padding-top:10px;padding-right:10px;font-size:10px">
              <ul>
                <xsl:for-each select="xml/rs:data/z:row">
                  <li type="square" style="color:#4f4f4f">
                    <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                      <xsl:value-of select="current()/@ows_Surtitre" />
                    </span>
                    <br />
                    <a style="font-size:11px;font-weight:bold">
                      <xsl:if test="normalize-space(//BaseUrl) != ''">
                        <xsl:attribute name="href">
                          <xsl:value-of select="//BaseUrl" />
                          <xsl:value-of select="current()/@ows_ID" />
                        </xsl:attribute>
                      </xsl:if>
                      <span style="color:#ce2d6b">
                        <xsl:value-of select="current()/@ows_Title" />
                      </span>
                    </a>
                    <span style="color:gray;font-size:8px;font-weight:bold">
                      (<xsl:value-of select="Avanade:FormatDate(current()/@ows_Created)" />)
                    </span>
                    <br />
                  </li>
                  <br />
                </xsl:for-each>
              </ul>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Titre et Surtitre (Sans date) -->
      <xsl:when test="//DisplayStyle = '3'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart ANNONCE">
          <tr>
            <td style="background-color:#ffffff;width:100%;vertical-align:top;height:0%;padding-top:10px;padding-right:10px;font-size:10px">
              <ul>
                <xsl:for-each select="xml/rs:data/z:row">
                  <li type="square" style="color:#4f4f4f">
                    <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                      <xsl:value-of select="current()/@ows_Surtitre" />
                    </span>
                    <br />
                    <a style="font-size:11px;font-weight:bold">
                      <xsl:if test="normalize-space(//BaseUrl) != ''">
                        <xsl:attribute name="href">
                          <xsl:value-of select="//BaseUrl" />
                          <xsl:value-of select="current()/@ows_ID" />
                        </xsl:attribute>
                      </xsl:if>
                      <span style="color:#ce2d6b">
                        <xsl:value-of select="current()/@ows_Title" />
                      </span>
                    </a>
                    <br />
                  </li>
                  <br />
                </xsl:for-each>
              </ul>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Titre et corps -->
      <xsl:when test="//DisplayStyle = '4'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart VIDEO">
          <tr>
            <td style="padding:10px">
              <xsl:for-each select="xml/rs:data/z:row">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      <br />
                      <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                        <xsl:value-of select="current()/@ows_Surtitre" />
                      </span>
                      <br />
                      <xsl:choose>
                        <xsl:when test="normalize-space(//BaseUrl) != ''">
                          <a style="font-size:11px;font-weight:bold">
                            <xsl:attribute name="href">
                              <xsl:value-of select="//BaseUrl" />
                              <xsl:value-of select="current()/@ows_ID" />
                            </xsl:attribute>
                            <span style="color:#ce2d6b">
                              <xsl:value-of select="current()/@ows_Title" />
                            </span>
                          </a>
                        </xsl:when>
                        <xsl:otherwise>
                          <span style="font-size:11px;font-weight:bold;color:#ce2d6b">
                            <xsl:value-of select="current()/@ows_Title" />
                          </span>
                        </xsl:otherwise>
                      </xsl:choose>
                      <span style="color:gray;font-size:8px;font-weight:bold">
                        (<xsl:value-of select="Avanade:FormatDate(current()/@ows_Created)" />)
                      </span>
                      <br/>
                      <br/>
                      <div style="clear:both;vertical-align:top">
                        <xsl:if test="normalize-space(translate(current()/@ows_Photo, ',', '')) != ''">
                          <div style="float:left;padding-right:10px">
                            <a>
                              <xsl:if test="normalize-space(//BaseUrl) != ''">
                                <xsl:attribute name="href">
                                  <xsl:value-of select="//BaseUrl" />
                                  <xsl:value-of select="current()/@ows_ID" />
                                </xsl:attribute>
                              </xsl:if>
                              <img style="border:solid 1px #fce4ee;">
                                <xsl:attribute name="src">
                                  <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)" />
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                          <div>
                            <xsl:value-of select="current()/@ows_Body" />
                          </div>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="height:1px;background-color:#fce4ee;"></td>
                  </tr>
                </table>
              </xsl:for-each>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Titre et corps (Sans date) -->
      <xsl:when test="//DisplayStyle = '5'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart VIDEO">
          <tr>
            <td style="padding:10px">
              <xsl:for-each select="xml/rs:data/z:row">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      <br />
                      <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                        <xsl:value-of select="current()/@ows_Surtitre" />
                      </span>
                      <br />
                      <xsl:choose>
                        <xsl:when test="normalize-space(//BaseUrl) != ''">
                          <a style="font-size:11px;font-weight:bold">
                            <xsl:attribute name="href">
                              <xsl:value-of select="//BaseUrl" />
                              <xsl:value-of select="current()/@ows_ID" />
                            </xsl:attribute>
                            <span style="color:#ce2d6b">
                              <xsl:value-of select="current()/@ows_Title" />
                            </span>
                          </a>
                        </xsl:when>
                        <xsl:otherwise>
                          <span style="font-size:11px;font-weight:bold;color:#ce2d6b">
                            <xsl:value-of select="current()/@ows_Title" />
                          </span>
                        </xsl:otherwise>
                      </xsl:choose>
                      <br/>
                      <br/>
                      <div style="clear:both;vertical-align:top">
                        <xsl:if test="normalize-space(translate(current()/@ows_Photo, ',', '')) != ''">
                          <div style="float:left;padding-right:10px">
                            <a>
                              <xsl:if test="normalize-space(//BaseUrl) != ''">
                                <xsl:attribute name="href">
                                  <xsl:value-of select="//BaseUrl" />
                                  <xsl:value-of select="current()/@ows_ID" />
                                </xsl:attribute>
                              </xsl:if>
                              <img style="border:solid 1px #fce4ee;">
                                <xsl:attribute name="src">
                                  <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)" />
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                          <div>
                            <xsl:value-of select="current()/@ows_Body" />
                          </div>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="height:1px;background-color:#fce4ee;"></td>
                  </tr>
                </table>
              </xsl:for-each>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Photo et chapeau -->
      <xsl:when test="//DisplayStyle = '6'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart ANNONCE">
          <tr>
            <td style="padding:10px">
              <xsl:for-each select="xml/rs:data/z:row">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      <br/>
                      <div style="clear:both;vertical-align:top">
                        <xsl:if test="normalize-space(translate(current()/@ows_Photo, ',', '')) != ''">
                          <div style="float:left;padding-right:10px">
                            <img style="border: solid 1px #fce4ee;">
                              <xsl:attribute name="src">
                                <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)" />
                              </xsl:attribute>
                            </img>
                          </div>
                        </xsl:if>
                          <div>
                            <xsl:value-of select="Avanade:FormatBody(current()/@ows_Chapeau)" />
                          </div>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="height:1px;background-color:#fce4ee;"></td>
                  </tr>
                </table>
              </xsl:for-each>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Corps -->
      <xsl:when test="//DisplayStyle = '7'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart VIDEO">
          <tr>
            <td style="padding:10px">
              <xsl:for-each select="xml/rs:data/z:row">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      <br/>
                      <div style="clear:both;vertical-align:top">
                        <xsl:if test="normalize-space(translate(current()/@ows_Photo, ',', '')) != ''">
                          <div style="float:left;padding-right:10px">
                            <a>
                              <xsl:if test="normalize-space(//BaseUrl) != ''">
                                <xsl:attribute name="href">
                                  <xsl:value-of select="//BaseUrl" />
                                  <xsl:value-of select="current()/@ows_ID" />
                                </xsl:attribute>
                              </xsl:if>
                              <img style="border:solid 1px #fce4ee;">
                                <xsl:attribute name="src">
                                  <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)" />
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                          <div>
                            <xsl:value-of select="current()/@ows_Body" />
                          </div>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="height:1px;background-color:#fce4ee;"></td>
                  </tr>
                </table>
              </xsl:for-each>
            </td>
          </tr>
          <xsl:if test="normalize-space(//NewFormURL) != ''">
            <tr>
              <td class="ms-addnew">
                <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//NewFormURL" /><![CDATA[">Ajouter une nouvelle annonce</a>]]>
              </td>
            </tr>
          </xsl:if>
        </table>
      </xsl:when>
      <!-- Volet de visualisation -->
      <xsl:when test="//DisplayStyle = '8'">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart ANNONCE">
          <tr>
            <td style="background-color:#ffffff;width:20%;vertical-align:top;height:0%;padding-top:10px;padding-right:10px;font-size:10px;border-right:solid 1px #88c917">
              <script type="text/javascript">
                function showPreviewVP(o)
                {
                f = document.getElementById('previewPane');
                f.innerHTML =  unescapeProperly(o.getAttribute('Preview'))+'&amp;nbsp;';
                }
              </script>
              <ul>
                <xsl:for-each select="xml/rs:data/z:row">
                  <li type="square" style="color:#4f4f4f">
                    <span style="text-transform:uppercase;color:#4f4f4f;font-weight:bold">
                      <xsl:value-of select="current()/@ows_Surtitre" />
                    </span>
                    <br />
                    <a style="font-size:11px;font-weight:bold" onmouseover="showPreviewVP(this);" onfocus="showPreviewVP(this);">
                      <xsl:if test="normalize-space(//BaseUrl) != ''">
                        <xsl:attribute name="href">
                          <xsl:value-of select="//BaseUrl" />
                          <xsl:value-of select="current()/@ows_ID" />
                        </xsl:attribute>
                      </xsl:if>
                      <xsl:attribute name="Preview">
                        <xsl:value-of select="current()/@ows_Preview" />
                      </xsl:attribute>
                      <span style="color:#ce2d6b">
                        <xsl:value-of select="current()/@ows_Title" />
                      </span>
                    </a>
                    <span style="color:gray;font-size:8px;font-weight:bold">
                      (<xsl:value-of select="Avanade:FormatDate(current()/@ows_Created)" />)
                    </span>
                    <br />
                  </li>
                  <br />
                </xsl:for-each>
              </ul>
            </td>
            <td id="previewPane" style="background-color:#ffffff;width:80%;vertical-align:top;height:0%;padding-top:10px;padding-right:10px;font-size:10px;border-left:solid 1px #88c917"></td>
          </tr>
        </table>
      </xsl:when>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>